package cn.data.collection.util;

public class NumberUtils {
	
	public static String yaohao(final String areaNum, final String date, final int number) {
		StringBuilder sb = new StringBuilder();
		sb.append(areaNum);
		sb.append(date);
		if (number < 10) {
			sb.append("000");
		} else if (10 <= number && number < 100) {
			sb.append("00");
		} else if (100 <= number && number < 1000) {
			sb.append("0");
		}
		sb.append(number);
		return sb.toString();
	}

	public static String yaohao(final String haoma, final int quene) {
		StringBuffer sb = new StringBuffer();
		sb.append(haoma);
		if (quene < 10) {
			sb.append("000");
		} else if (10 <= quene && quene < 100) {
			sb.append("00");
		} else if (100 <= quene && quene < 1000) {
			sb.append("0");
		}
		sb.append(quene);
		return sb.toString();
	}

	public static int currentQuene(final String yaohaoNum) {
		return Integer.valueOf(yaohaoNum.substring("0420150512".length()));
	}

	public static void main(String[] args) {
		System.out.println("0420150512".length());
		// System.out.println(NumberUtils.yaohao(AreaNumConstant.YUEXIU.getCode(),"20150512",
		// 1));
	}
}
